home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
025a
/
intouch.zip
/
BLD_DBF.DOC
< prev
next >
Wrap
Text File
|
1991-11-10
|
11KB
|
247 lines
Creation Date: 11/01/1987 Last Modified: 02/08/1988
BLD_DBF
Build a dBase III Compatbable
database file from DOS
Author : Richard P. Hendricks
Version: 1.2
Date : Feb 08, 1988
COPYRIGHT (C) 1987, 1988
DESCRIPTION:
BLD_DBF allows the user to create and load a dBase III compatable database
file. The structure of the database is defined by an ASCII file that contains
the structure specification. There are several options/switches that can be
used to influence the contents of the database. The loading process is similar
to the APPEND FROM ... SDF.
COMPATABILITY:
BLD_DBF will create database files that are compatable with:
* QuickSilver * Clipper
* dBase III * Alpha/three
* dBase III Plus
USAGE:
BLD_DBF is written to allow for data to be piped and filtered into it. The data
can come from another command such as DIR or from an ASCII file. There are
several swtiches that are available to affect the loading. The case of the
command line arguments is not important. The case of the data that is to be
loaded is preserved.
Drive and Path designations can be use along with all the file entries.
COMMAND SYNTAX:
BLD_DBF [ struc_file dbf_name [ switches ] <data_src [ >log_file ] ]
-or-
[ command(s) | ] BLD_DBF [ struc_file dbf_name [ switches ] [ >log_file ] ]
STRUC_FILE - the name of the ASCII sequential file that contains the
structure of the database. One line for each field. The
field name, type, length and decimal places are all separated
by one or more spaces. The dBase III standards are enforced
and all types are supported except for memo fields. The default
extension for this file is .STR . If the default structure of
TEXT C 80 0 is desired, enter *DEFAULT* in place of the
structure file name.
A special field type has been established. If the field type
is set to 'X' then the data will be read from the input stream
but the field description and related data will not be loaded
into the database. This is useful for skipping over unwanted
data, such as spaces, record numbers, etc. The length and
decimal places are the same as that of the character type,
ie, 254 and 0.
DBF_NAME - the name of the database file to be created. If the database
file already exists, then it will be overwritten without
warning. The default extension for this file is .DBF .
SWITCHES - there are several switches that can be used to affect the
loading process. The character that is used to identify
that the input is a switch or group of switches is a '/'.
Switches can be entered on the line individually or grouped
together. Example: /e /p can be specified as /ep
The switches are:
E - create an empty database. The structure of the
database is stored, but no records are added to
the database. There is no need to supply the
information related to the source of the data.
P - load the database is protect mode. Each time a
record is added to the database the record count
is also stored. This method is slower and under
most circumstances is not needed. The default is
to store the record count after all the records
have been loaded.
S - abort the loading process if the incoming data
is too short for the specified structure. The
default is to pad the field with spaces.
L - abort the loading process if the incoming data
is too long for the specified structure. The
default is to truncate the records that are too
long.
X - abort the loading process if the incoming data
is not the exact length for the specified structure.
The default is to pad the short fields with spaces
and truncate the records that are too long.
M:nnn - skip the incoming record if the incoming data is
less than the length that is specified by nnn. This
is useful in keeping out data that is of a different
format, but is in the input stream. An example is
with the directory command. The data related to the
file information is 40 characters long and the
titles, etc are 39 or less. By specifying nnn = 39
then only the file information will be loaded.
Q - load in a quite mode. BLD_DBF does not report alot
of information back to the screen, but there is
some. If you are running BLD_DBF within a program
using RUN/! then you may not want any messages to
be sent to the screen. The use of a log file might
also accomplish this. Errors are not surpress by
this option, only warnings and informative messages.
? - provide on line help. BLD_DBF will return to the
screen a summary of this documentation. The
information can be directed to a file or printer.
See log file command line argument. This information
will also be displayed if only BLD_DBF is entered
at DOS.
DATA_SRC - the name of the ASCII file that contains the data to be loaded
into the database file. The data should be configured so that
the specified field lengths can be used to separate the data.
This is similar to the dBase III command APPEND FROM ... SDF.
There is no default extension for this file. If a source of
the data is not supplied then BLD_DBF is directed by DOS to
read the input from the console. To exit this situation, press
Ctrl-Z and [Enter]. The '<' character tells DOS to feed to
BLD_DBF the information that is found in the file.
LOG_FILE - the name of the file or device that is to recieve the
informative messages, warnings and error messages. The only
screen output that cannot be redirected is the 25 CR's that
are issued to clear the screen when Help ( /? ) is asked for.
The '>' character tells DOS to direct the screen output from
BLD_DBF to the designated file or device. The '>>' will cause
the screen output to be appended to the designated file or
device.
For example: BLD_DBF /? >PRN will direct the on line help to
the printer.
COMMAND(S) - other programs or commands can generate the data that is to be
loaded into the database. A good example is the DIR command.
The output from the DIR command can be passed to the BLD_DBF
program to be loaded into database file. For example:
DIR | BLD_DBF *DEFAULT* DIRLIST
This will create a database, DIRLIST.DBF, that contains the
output of the DIR command. The structure of the database is
1 field with a name of TEXT, type of character, length of 80
and decimals of 0. Other variations can be applied, such as
sorting the data prior to loading.
DIR | SORT | BLD_DBF *DEFAULT* DIRLIST
The '|' character tells DOS to pass the screen output from
the preceeding program or command onto the program or command
that follows.
Example Structure Files:
File: DIR.STR - Structure to Capture Directory Information in to a database
NAME C 8 0
pad1 C 1 0
EXTENSION C 3 0
pad2 C 1 0
SIZE N 8 0
pad3 C 2 0
DATE D 8 0
pad4 C 2 0
TIME C 5 0
AMPM C 1 0
Usage: DIR | BLD_DBF DIR DIRLIST /M:39
This will load the output from the DIR command into a database with
the above structure. The /m:39 switch will cause only the file data
to be loaded, ie., no titles such as 'Volume in drive B has no label'
or blank lines.
File: CHKDSK.STR - Structure to Capture CHKDSK Information in to a database
SIZE N 9 0
pad1 C 1 0
DESCRIPT C 25 0
Usage: CHKDSK | BLD_DBF CHKDSK CHKDSK /M:1
This will load the output from the CHKDSK command into a database with
the above structure. The /m:1 switch will cause only the disk and memory
data to be loaded, ie., no blank lines.
File: XDIR.STR - Structure to Capture Directory Information into a database
without any of the spacing found between fields. Uses the
special field type 'X'.
NAME C 8 0
pad1 X 1 0
EXTENSION C 3 0
pad2 X 1 0
SIZE N 8 0
pad3 X 2 0
DATE D 8 0
pad4 X 2 0
TIME C 5 0
AMPM C 1 0
Usage: DIR | BLD_DBF XDIR XDIRLIST /M:39
This will load the output from the DIR command into a database with
the above structure. The data corresponding to the PADx fields will
be read, but not loaded into the database. The /m:39 switch will cause
only the file data to be loaded, ie., no titles such as
'Volume in drive B has no label' or blank lines.
File: PHONE.STR - Structure for the Phone list database
FNAME C 10 0
LNAME C 15 0
AREACODE C 3 0
PHONENUM C 7 0
Usage: BLD_DBF PHONE PHONE <PHONE.LST
This will load the data that is stored in the data file PHONE.LST into
the database PHONE.DBF with the structure PHONE.STR.